package com.hzit.executor.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Configuration
public class MyExecutorConfig {

	/**
	 * 创建线程池并放到spring容器中
	 * @return
	 */
	@Bean
	public ExecutorService executorService(){
		return new ThreadPoolExecutor(50, 500, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10000));
	}
}
